<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<sj:head jqueryui="true" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>EVON Global Logistics Solution</title>
<link href="../css/style.css" rel="stylesheet" type="text/css" />
</head>
<script language="JavaScript" src="${pageContext.request.contextPath}/struts/utils.js" type="text/javascript"></script>
 <script language="JavaScript" src="${pageContext.request.contextPath}/struts/xhtml/validation.js" type="text/javascript"></script>
<SCRIPT type="text/javascript">

function assignTransporter(yardId){
	var url="assignTransporter?yardId="+yardId;
	  window.open(url,"_blank","directories=no, status=no,width=300, height=200,top=0,left=0");
	
}

function assignDriver(yardId){
	var url="assignDriver?yardId="+yardId;
	  window.open(url,"_blank","directories=no, status=no,width=300, height=200,top=0,left=0");
	
}

</SCRIPT>
<body>
<sj:div id="carExitDiv" cssClass="maincontent" indicator="indicator">

<h2>Please enter the car details / Chasis number to get the parking
details</h2>

<s:fielderror ></s:fielderror>
<s:actionerror/>
<s:actionmessage/>
<s:form id="form1"  theme="simple" validate="true">

	<div id="searchDiv" class="maincontent">
	<s:hidden name="carDTO.id"  id="carDTO.id" value="%{carDTO.id}"/>
	
	<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" >
		<tr>
			<td width="10%"><b>Select Yard : </b></td>
			<td>
				<s:select label="Select Yard" headerKey="-1"
					headerValue="Select Yard" list="listYard" listKey="id"
					listValue="name" name="selectedYardId" />
			</td>
		</tr>
		<tr>
			<td width="10%"><b>Chasis Number :</b></td>
			<td width="50%">
				<s:textfield name="carDTO.carChasisNumber"
					label="Chasis Number" value="%{carDTO.carChasisNumber}" /></td>
			<td></td>
		</tr>
		<tr>
		<td></td>
			<td align="left">
			<s:url var="carExitUrl" action="carExit" ></s:url>
			<sj:submit  formIds="form1" value="Search" name="Search"  href="%{carExitUrl}" cssClass="btnbg"  targets="carExitDiv" indicator="indicator"/>
			<s:url var="driverSelectedUrl" action="driverSelected" ></s:url>
			
			<!--<s:submit value="Search"
				name="Search"  cssClass="btnbg"/>
		--></tr>
	</table>
	
	</div>
	<div id="detailDiv" class="subnavcontent">

	<table width="100%" border="0" align="center" cellpadding="4"
		cellspacing="1" class="gridtable">
		
		<tr>
			<td width="15%">OEM Name : </td>
			<td width="35%"><s:label label="Car Manufacturer"
						value="%{carDTO.carManufacturer.oemName}" />
			</td>
			<td width="15%">Car Model :</td>
			<td> 
				<s:label label="Car Model"
						value="%{carDTO.carModel}" />
			</td>

		</tr>


		<tr>
			<td width="15%">Car Number : </td>
			<td width="35%"><s:label label="Car Number"
						value="%{carDTO.carNumber}" />
			</td>
			<td width="15%">Fuel variant :</td>
			<td> 
				<s:label label="Car Color"
						value="%{carDTO.carVerient}" />
			</td>

		</tr>

		<tr>
			<td width="15%">Color :</td>
			<td width="35%">
				<s:label label="Car Color"
						value="%{carDTO.carColor}" />
			</td>
			<td width="15%">Chasis Number :</td>
			<td> 
				<s:label label="Car Color"
						value="%{carDTO.carChasisNumber}" />
			</td>

		</tr>

		<tr>
			<td width="15%">Yard :</td>
			<td width="35%">
				<s:label label="Yard Name"
						value="%{carDTO.parkingSlot.section.yardDTO.name}" />
			</td>
			<td width="15%">Key Number :</td>
			<td> 
				<s:label label="Key Number"
						value="%{carDTO.keyNumber}" />
			</td>

		</tr>

		<tr>
			<td width="15%">Section : </td>
			<td width="35%">
				<s:label label="Section Name"
						value="%{carDTO.parkingSlot.section.sectionName}" />
			</td>
			<td width="15%">Parking Slot : </td>
			<td> 
				<s:label label="Parking Slot"
						value="%{carDTO.parkingSlot.slotName}" />
			</td>

		</tr>

		<tr>
			<td width="15%">Parking Driver : </td>
			<td width="35%">
				<s:label label="Parking Driver"
						value="%{carDTO.member.name}" />
			</td>
			<td width="15%">Retrieving Driver :</td>
			<td> 
			<s:label label="Retrieveing Driver"
						value="%{carDTO.retrievalDriver.name}" />
				<!--<s:select label="Select Member"
					headerKey="-1" headerValue="Select Member" list="availableMembers"
					listKey="id" listValue="firstName" name="selectedMemberId" />
			--></td>

		</tr>

		<tr>
			<td width="15%">Parking Date and Time :</td>
			<td width="35%">
				<s:label label="Parking Time"
						value="%{carDTO.parkingTime}" />
			</td>
			<td width="15%">Retrieval Date and Time :</td>
			<td> 
				<s:label label="Retrieval Time"
						value="%{carDTO.retrievalTime}" />
			</td>

		</tr>
		<tr>
			<td width="15%">Assigned Transporter :</td>
			<td width="35%">
				<s:label label="selectedTransporterId"
						value="%{carDTO.transporterDTO.name}" />
			</td>
			<td width="15%">Retrieval Date and Time :</td>
			<td> 
			
			</td>

		</tr>
		
	</table>
	<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
		<tr>
		<td style="height:10px;"></td>
		</tr>
		<tr>
		<td align="right">
		
		<s:url var="retrievalRequestUrl" action="retrievalRequest" ></s:url>
		
		<!--<s:url var="assignDriverUrl" action="assignDriver" >
		<s:param name="yardId" value="101" ></s:param>
		</s:url>
		
		-->
		<sj:submit   value="Retrieval Request" href="%{retrievalRequestUrl}"
				name="Retrieval Request"   cssClass="btnbg" indicator="indicator" targets="dummyDiv"/>
			<sj:div id="dummyDiv" name="dummyDiv"></sj:div>
	
	 <!--   <sj:dialog id="mydialog3" href="%{assignDriverUrl}" title="Assign Driver" autoOpen="false"/>
   		
   		--><!--<sj:a openDialog="mydialog3">Open Dialog</sj:a>
		--><!--<input type="button" value="Retrieval Request"
						name="Retrieval Request" onclick="assignDriver('101')" class="btnbg"/>
		-->
		</td>		
		
		<td align="right">
		<s:url var="confirmCarRetrievalUrl" action="confirmCarRetrievalAction" ></s:url>
		
		<sj:submit formIds="form1" value="Confirm Vehicle" href="%{confirmCarRetrievalUrl}"
				name="Confirm Vehicle"   cssClass="btnbg" targets="carExitDiv" indicator="indicator"/>
				
		</td>
			
		</tr>
		<tr>
			<td>
				<td align="right">
				<s:url var="assignTransporterUrl" action="assignTransporter" ></s:url>
		
				<sj:submit   value="Assign Transporter" href="%{assignTransporterUrl}"
					name="Assign Transporter"   cssClass="btnbg" indicator="indicator" targets="dummyDiv"/>
			</td>
		
		</tr>
		</table>
		
	</div>
</s:form>

<p><a href="<s:url action='yard'/>">Display yards</a></p>
</sj:div>
</body>
</html>